import Mod_bl as bl
import unittest

class TestSequenceFunctions(unittest.TestCase):
    
    def setUp(self):
        bl.metadata.create_all()
        stmt = bl.scores_table.delete()
        stmt.execute()
        i = bl.scores_table.insert()
        self.session = bl.Session()
        i.execute(author='AX', title='TX')
        for x in range(10):
            author, title = 'A' + str(x), 'T' + str(x)
            i.execute({'author': author, 'title': title},)

    def tearDown(self):
            pass

    def testRetrieve(self):
        s = self.session
        scoreList = [x for x in s.query(bl.scores_table)]
        self.assertEqual(scoreList[0], (1, u'AX', u'TX'))

if __name__ == '__main__':
    unittest.main()

